libotutil: Drop accidental use of GLib 2.36 API
authorColin Walters <walters@verbum.org>
Sun, 18 Aug 2013 11:50:50 +0000 (07:50 -0400)
committerColin Walters <walters@verbum.org>
Sun, 18 Aug 2013 11:50:50 +0000 (07:50 -0400)
Sticking with 2.34 for a while longer.

src/libotutil/ot-variant-utils.c

index ecf6c842718d168533ef97b93019b16cb62071a4..7b034a422f2af8c9de4fe75b68f44766f2565955 100644 (file)
@@ -44,7 +44,12 @@ ot_gvariant_new_bytearray (const guchar   *data,
 GVariant *
 ot_gvariant_new_ay_bytes (GBytes *bytes)
 {
-  return g_variant_new_from_bytes (G_VARIANT_TYPE ("ay"), bytes, TRUE);
+  gsize size;
+  gconstpointer data;
+  data = g_bytes_get_data (bytes, &size);
+  g_bytes_ref (bytes);
+  return g_variant_new_from_data (G_VARIANT_TYPE ("ay"), data, size,
+                                  TRUE, (GDestroyNotify)g_bytes_unref, bytes);
 }
 
 GHashTable *